package com.example.rocketmqdemo.message;

import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.spring.annotation.ConsumeMode;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

/**
 * @ClassName OrderlyCustomer
 * @Description TODO
 * @Author 郭敖
 * @Date 2023年12月12日 23:17
 * @Version 1.0
 */
@Slf4j
@Component
@RocketMQMessageListener(consumerGroup = "group4",
        selectorExpression = "orderly",
        topic = "orderly-topic1",
        consumeMode = ConsumeMode.ORDERLY,
        consumeThreadNumber = 1)
public class OrderlyCustomer implements RocketMQListener {
    @Override
    public void onMessage(Object o) {
        log.info("收到消息：{}",o);
    }
}
